package com.example.Reprository;

import com.example.Model.City;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import sun.util.resources.it.CurrencyNames_it_IT;

import javax.transaction.Transactional;
import java.util.List;

/**
 * Created by Administrator on 2017/5/2.
 */
@Repository
public interface CityDao extends CrudRepository<City, Long> {
   @Transactional
   @Modifying
   @Query("select c from City c")
   List<City> getList();
    City findById(@Param("id") Long id);

}
